package com.neuronbit.businessflow.runtime;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.lang.reflect.Type;

/**
 * The type Gson utils.
 */
public class GsonUtil {
    /**
     * The constant gson.
     */
    public static Gson gson = new Gson();


    /**
     * To json string.
     *
     * @param collect the collect
     * @return the string
     */
    public static String toJson(Object collect) {
        return gson.toJson(collect);
    }

    public static Object fromJson(String json, Class<?> classOfT) {
        return gson.fromJson(json, classOfT);
    }
}
